<template>
  <div class="inviteinfo">
    <gltitle
      :titleSize="titleSize"
      :is_mt="is_mt"
      v-if="!$store.state.isApp"
    ></gltitle>
    <div
      :style="{ paddingTop: !$store.state.isApp ? '1.2rem' : '.2rem' }"
    ></div>
    <div class="invitecode">
      <div class="invitecode-item">
        <div class="item-name">{{$t('bargain.account')}}</div>
        <div class="item-info">{{recordinfo.userName}}</div>
      </div>
      <div class="invitecode-item">
        <div class="item-name">{{$t('bargain.type')}}</div>
        <div class="item-info"> {{$t('bargain.typename',{n1:recordinfo.productLevel,n2:recordinfo.outputCoinName})}}</div>
      </div>
      <div class="invitecode-item">
        <div class="item-name">{{$t('bargain.buynum')}}</div>
        <div class="item-info">{{$t('bargain.buynumdata',{n1:recordinfo.paymentQuantity})}}</div>
      </div>
       <div class="invitecode-item">
        <div class="item-name">{{$t('bargain.money')}}</div>
        <div class="item-info">{{recordinfo.paymentAmount}}</div>
      </div>
        <div class="invitecode-item" v-if="type==2">
        <div class="item-name">{{$t('bargain.amountcut')}}</div>
        <div class="item-info">{{recordinfo.quotaAmount}}</div>
      </div>
      <div class="invitecode-item" v-if="type==2">
        <div class="item-name">{{$t('bargain.getmoney')}}</div>
        <div class="item-info">{{recordinfo.realQuotaAmount}}</div>
      </div>
      <div class="invitecode-item" v-if="type==1">
        <div class="item-name">{{$t('bargain.obtained')}}</div>
        <div class="item-info">{{recordinfo.realQuotaAmount}}</div>
      </div>
      <div class="invitecode-item">
        <div class="item-name">{{$t('bargain.time')}}</div>
        <div class="item-info">{{recordinfo.date}}</div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      titleSize: this.$t("title.inviteinfo"),
      is_mt: true,
      recordinfo: {},
      type:1
    };
  },
  created() {
      this.type=this.$route.query.type;
    this.$post(this.URL.bargain.inviterecordinfo, {
      recordId: this.$route.query.id,
    }).then((res) => {
      if (res.code == 0) {
        this.recordinfo = res.data;
      } else {
        this.$toast(res.message);
      }
    });
  },
};
</script>

<style lang="less" scoped>
.inviteinfo {
  .invitecode {
    width: 7.1rem;
    margin: 0 auto;
    padding: 0.34rem 0;
    background: #fff;
    border-radius: .12rem;
    .invitecode-item {
      padding: 0 .32rem;
      display: flex;
        font-size: .28rem;
        padding-bottom: .24rem;
        &:last-child{
            padding-bottom: 0;
        }
      .item-name{
          flex: 0 0 3rem;
          color: #999999;
        line-height: .32rem;
      }
      .item-info{
          flex: 1;
          color: #333333;
          text-align: right;
      }
    }
  }
}
</style>
